module Mix.Views.Base {
    /**
     * Button
     */
    export class Button extends eui.Button {
        constructor() {
            super();

            //按下缩小
            this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTouchBeginShow,this);

            //弹起放大
            this.addEventListener(egret.TouchEvent.TOUCH_END,this.onTouchOverShow,this);

            //外围弹起放大
            this.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE,this.onTouchOverShow,this);
        }

        /**
         * 按下时执行的事件
         */
        protected onTouchBeginShow(){
            this.scaleX = 0.8;
            this.scaleY = 0.8;
        }

        /**
         * 弹起及外围弹起执行的事件
         */
        protected onTouchOverShow(){
            this.scaleX = 1;
            this.scaleY = 1;
        }
    }
}